package list.com.Test3;

import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;

public class DateDemo1 {
    public static void main(String[] args) {
        String time = "2099-12-03";
        String birthday ="1997-12-01";

        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");

        LocalDate parse1 = LocalDate.parse(time, dateTimeFormatter);
        LocalDate parse2 = LocalDate.parse(birthday, dateTimeFormatter);

        long between1 = ChronoUnit.DAYS.between(parse2,parse1);
        System.out.println("可以活："+between1);
    }
}
